import React, { Component } from 'react'

export default class Son extends Component {
    state = {
        str: "我是子组件中的数据"
    }
    render() {
        const { str } = this.state
        const { sendStr } = this.props
        return (
            <div>
                Son -- { str }
                <div>
                    <button onClick={ () => {
                        sendStr(str)
                    } }>点我传递</button>
                </div>
            </div>
        )
    }
}